package cosc617_blackteam;

import java.util.ArrayList;

/**
 * @author Laura
 * Iterator that iterates through all tabs
 */
public class DefaultTabIterator implements I_TabIterator {
	ArrayList<I_Tab> tabs;
	private int index; //index of current Item
	
	public DefaultTabIterator(ArrayList<I_Tab> tabs){
		index = 0;
		this.tabs = tabs;	
	}
	
	
	@Override
	public boolean hasNext() {
		//no criteria to filter Tab list so same as traversing the array
		return index < tabs.size() ;
	}

	@Override
	public I_Tab next() {
		I_Tab output;
		if(hasNext())
			output = tabs.get(index);
		else output = null;
		index++;
		return output;
	}


	@Override
	public void remove() {
		throw new UnsupportedOperationException();
		
	}
	

}


